package com.sds.shop.action;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.sds.fw.mvc.Action;
import com.sds.fw.mvc.HttpUtil;
import com.sds.shop.dao.BoardDAO;
import com.sds.shop.vo.BoardVO;

public class ModifyBoardAction extends Action {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException {
		HttpSession session = request.getSession();
		request.setCharacterEncoding("euc-kr");
		BoardVO vo = (BoardVO)session.getAttribute("modboardInfo");
		vo.setTitle(request.getParameter("title"));
		vo.setText(request.getParameter("text"));
		BoardDAO dao = BoardDAO.getInstance();
		
		dao.updateBoard(vo);
		HttpUtil.forward(request,response,"board.do");
		

	}

}
